home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Borland Plateform / Turbo Prolog 2 / EXAMPL43.PRO < prev    next >
Encoding:
Prolog Source  |  1986-04-23  |  592 b   |  22 lines

  1.                /* Program 43 */
  2. domains
  3.     file = myfile
  4. predicates
  5.     start
  6.     readin(char)
  7. goal
  8.    start.    
  9. clauses
  10.     start:-
  11.         write("this program reads your input and writes it to tryfile.one\n"),
  12.         openwrite(myfile,"tryfile.one"),
  13.         writedevice(myfile),
  14.         readchar(X),
  15.         readin(X),
  16.         closefile(myfile),
  17.         writedevice(screen),
  18.         write("Your input has been transferred a file").
  19.     readin( '#' ):-!.
  20.     readin('\13'):-!,write("\13\10"),readchar(X),readin(X).
  21.     readin(  X  ):- write(X),readchar(Y),readin(Y).
  22.